<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>服务通知</title>
		<!-- css代码 start -->
		<link rel="stylesheet" href="../../../css/mui.min.css">
		<link rel="stylesheet" href="../../../css/global.css">
		<link rel="stylesheet" href="../../../css/style.css">		
		<style>
			.part_cen li .sum {
				line-height: 16px;
				margin-top: 15px;
				padding: 0 4px;
				border-radius: 10px;
				background: #ea1e1a;
				font-size: 14px;
				color: #fff;
			}
		</style>
		<!-- css代码 end -->
	</head>
	<body>

		<!-- html代码 start -->
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">服务通知</h1>
		</header>
		<div class="mui-content">
			<ul class="part_cen" style="margin: 0;">
				<li id="dzpfu" style="display: none;">
					<img src="../../../images/icon_206.png" />
					待指派服务
					<span id="dzpfuSum" class="sum fr">0</span>
					<!-- <span class="mui-icon mui-icon-arrowright arrow-right-position p"></span> -->
				</li>
				<li id="djsfw"><img src="../../../images/icon_207.png" />待接受服务
					<span id="djsfwSum" class="sum fr">0</span>
				<!-- <span class="mui-icon mui-icon-arrowright arrow-right-position p"></span> --></li>
				<li id="accepted"><img src="../../../images/icon_208.png" />已接受服务
					<span id="acceptedSum" class="sum fr">0</span>
				<!-- <span class="mui-icon mui-icon-arrowright arrow-right-position p"></span> --></li>
				<li id="checkedIn"><img src="../../../images/icon_210.png" />已签到服务
					<span id="checkedInSum" class="sum fr">0</span>
				<!-- <span class="mui-icon mui-icon-arrowright arrow-right-position p"></span> --></li>
				<li id="checkedOut"><img src="../../../images/icon_211.png" />已签离服务
					<span id="checkedOutSum" class="sum fr">0</span>
				<!-- <span class="mui-icon mui-icon-arrowright arrow-right-position p"></span> --></li>
				<li id="autoCheckedOut"><img src="../../../images/icon_209.png" />自动签离服务
					<span id="autoCheckedOutSum" class="sum fr">0</span>
				<!-- <span class="mui-icon mui-icon-arrowright arrow-right-position p"></span> --></li>
				<li id="completed"><img src="../../../images/icon_212.png" />已完成服务
					<span id="completedSum" class="sum fr">0</span>
				<!-- <span class="mui-icon mui-icon-arrowright arrow-right-position p"></span> --></li>
				<li id="closed"><img src="../../../images/icon_213.png" />已关闭服务
				<span class="mui-icon mui-icon-arrowright arrow-right-position p"></span></li>
				<li id="team"  style="display: none;"><img src="../../../images/icon_214.png" />查询团队服务通知
					<span id="teamSum" class="sum fr">0</span>
				<!-- <span class="mui-icon mui-icon-arrowright arrow-right-position p"></span> --></li>
				<li id="notClosed"><img src="../../../images/icon_215.png" />查询未关闭服务通知
					<span id="notClosedSum" class="sum fr">0</span>
				<!-- <span class="mui-icon mui-icon-arrowright arrow-right-position p"></span> --></li>
				<li id="ccNotClosed"><img src="../../../images/icon_216.png" />查询APP不可操作服务通知
				<span class="mui-icon mui-icon-arrowright arrow-right-position p"></span></li>
			</ul>
		</div>

		<!-- js代码 start -->

		<!-- 基础js start -->
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/utils/h.js"></script>
		<script src="../../../js/constant.js"></script>
		<script src="../../../js/common.js"></script>
		<script src="../../../js/utils/base64.js"></script>
		<script src="../../../js/utils/md5.js"></script>
		<script src="../../../js/utils/sortMap.js"></script>
		<script src="../../../js/utils/http.js"></script>
		<script src="../../../js/app.js"></script>
		<!-- 基础js end -->

		<script type="text/javascript" charset="utf-8">
			(function($, doc) {
				$.init();

				$.plusReady(function() {
					if("Team Leader" == app.getUser().position){
						h("#dzpfu").show()
						h("#team").show()
					}
					
					// 获取各类服务通知数量
					getNoticeCount();

					//已接收
					h('#accepted').tap(function() {
						app.jumpTo('/view/service/notice/acceptedList.html','view/service/notice/acceptedList.html')
					})
					//已签到
					h('#checkedIn').tap(function() {
						app.jumpTo('/view/service/notice/checkedInList.html','view/service/notice/checkedInList.html')
					})
					//已签离
					h('#checkedOut').tap(function() {
						app.jumpTo('/view/service/notice/checkedOutList.html','view/service/notice/checkedOutList.html')
					})
					//已完成
					h('#completed').tap(function() {
						app.jumpTo('/view/service/notice/completedList.html','view/service/notice/completedList.html')
					})
					//已关闭
					h('#closed').tap(function() {
						app.jumpTo('/view/service/notice/closedList.html','view/service/notice/closedList.html')
					})
					//团队服务通知
					h('#team').tap(function() {
						app.jumpTo('/view/service/notice/teamList.html','view/service/notice/teamList.html')
					})
					//自动签离
					h('#autoCheckedOut').tap(function() {
						app.jumpTo('/view/service/notice/autoCheckedOutList.html','view/service/notice/autoCheckedOutList.html')
					})
					//查询未关闭服务通知
					h('#notClosed').tap(function() {
						app.jumpTo('/view/service/notice/notClosedList.html','view/service/notice/notClosedList.html')
					})
					
					//查询CC端未关闭服务通知
					h('#ccNotClosed').tap(function() {
						app.jumpTo('/view/service/notice/ccNotClosedList.html','view/service/notice/ccNotClosedList.html')
					})

					//待指派服务
					h('#dzpfu').tap(function() {
						app.jumpTo('/view/service/notice/toBeAssignedList.html','view/service/notice/toBeAssignedList.html')
					})
					
					//待接受服务
					h('#djsfw').tap(function() {
						app.jumpTo('/view/service/notice/toBeAcceptedList.html','view/service/notice/toBeAcceptedList.html')
					})
					
				});
			}(mui, document));
			
			// 获取各类服务通知数量
			function getNoticeCount() {
			    app.showWaiting()
			    ajaxGet(BASE_URL + "cc/noticeCount", {
			        "enginnerId": app.getUser().enginnerId,
			    }, function (data) {
					app.closeWaiting()
			        if (data.code == 200) {//查询成功
						var dzpfuSum = data.data && data.data.tobeAssignedCount ? data.data.tobeAssignedCount : 0; 
						var djsfwSum = data.data && data.data.tobeAcceptedCount ? data.data.tobeAcceptedCount : 0;
						var acceptedSum = data.data && data.data.acceptedCount ? data.data.acceptedCount : 0;
						var checkedInSum = data.data && data.data.signInCount ? data.data.signInCount : 0;
						var checkedOutSum = data.data && data.data.signOffCount ? data.data.signOffCount : 0;
						var autoCheckedOutSum = data.data && data.data.autoSignOffCount ? data.data.autoSignOffCount : 0;
						var completedSum = data.data && data.data.completedCount ? data.data.completedCount : 0;
						var teamSum = data.data && data.data.teamServiceNoticeCount ? data.data.teamServiceNoticeCount : 0;
						var notClosedSum = data.data && data.data.unfinishedCount ? data.data.unfinishedCount : 0;
						h("#dzpfuSum").html(dzpfuSum);
						h("#djsfwSum").html(djsfwSum);
						h("#acceptedSum").html(acceptedSum);
						h("#checkedInSum").html(checkedInSum);
						h("#checkedOutSum").html(checkedOutSum);
						h("#autoCheckedOutSum").html(autoCheckedOutSum);
						h("#completedSum").html(completedSum);
						h("#teamSum").html(teamSum);
						h("#notClosedSum").html(notClosedSum);
			        } else {
			            app.toast(data.msg);
			        }
			    }, function (errorMsg) {
			        app.closeWaiting()
					app.toast(errorMsg);
			    });
			}
		</script>
		<!-- js代码 end -->
	</body>
</html>
